<?php

namespace Gairal\AdminBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Gairal\CoreBundle\Entity\Menu;

class AdminController extends Controller {

    public function indexAction() {
        return $this->redirect($this->generateUrl('AdminMotivation'));
    }

    public function menuAction($routeName) {
        $menus = array(
            new Menu($routeName, 'Motivation', 'AdminMotivation'),
            new Menu($routeName, 'Experience', 'AdminExperience', array('AdminExperience', 'AdminExperienceAdd', 'AdminExperienceModify')),
            new Menu($routeName, 'Education', 'AdminEducation', array('AdminEducation', 'AdminEducationAdd', 'AdminEducationModify')),
            new Menu($routeName, 'Skills', 'AdminSkill', array('AdminSkill', 'AdminSkillAdd', 'AdminSkillModify')),
            new Menu($routeName, 'Interests', 'AdminInterest', array('AdminInterest', 'AdminInterestAdd', 'AdminInterestModify')),
            new Menu($routeName, 'Images', 'AdminImage', array('AdminImage','AdminImageAdd')),
            new Menu($routeName, 'Categories', 'AdminCategory', array('AdminCategory', 'AdminCategoryAdd', 'AdminCategoryModify')),
            new Menu($routeName, 'Travels', 'AdminTravel', array('AdminTravel', 'AdminTravelAdd', 'AdminTravelModify'))
        );
        return $this->render('::menu.html.twig', array(
            'menus' => $menus
        ));
    }

}